package Thread_.homework;

public class test5 {
    public static void main(String[] args) {
        //5.通过实现Runnable接口的形式,以lambda函数式创建线程
        Thread t=new Thread(()->{
            while(true){
                System.out.println("Thread5 run");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
        while(true){
            System.out.println("main");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
